Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove optional fields when unnecessary #216

Merged
merged 5 commits into from
Aug 22, 2024

Conversation

tomasciccola
Copy link
Contributor

should close #200

@tomasciccola tomasciccola requested a review from EvanHahn August 19, 2024 16:55
@EvanHahn
Copy link
Contributor

Lemme know when I should review this.

I could see splitting it into smaller PRs, but only if that's easier for you.

@@ -95,7 +95,8 @@ export const convertObservation: ConvertFunction<'observation'> = (
...rest,
attachments: message.attachments.map(convertAttachment),
tags: convertTags(message.tags),
metadata: message.metadata || {},
// @ts-ignore
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once I solve this type error, which I'm not being able for the time being, I think this is mostly ready to merge

Copy link
Contributor

@EvanHahn EvanHahn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM other than the ts-ignore error.

@tomasciccola tomasciccola marked this pull request as ready for review August 22, 2024 18:51
@tomasciccola tomasciccola requested a review from EvanHahn August 22, 2024 18:51
@EvanHahn EvanHahn changed the title Feat: remove optional fields when unnecessary feat: remove optional fields when unnecessary Aug 22, 2024
@@ -95,7 +95,7 @@ export const convertObservation: ConvertFunction<'observation'> = (
...rest,
attachments: message.attachments.map(convertAttachment),
tags: convertTags(message.tags),
metadata: message.metadata || {},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we set up a default value for metadata it should be smth like {manualLocation:true}, since manualLocation now is required. That field will default to false if undefined, so if we're okay with that, maybe we could leave it undefined?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as we don't accidentally get manualLocation: undefined when reading, I'm fine with whatever.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to this at least, we should be fine

@tomasciccola tomasciccola requested a review from EvanHahn August 22, 2024 18:58
@gmaclennan
Copy link
Member

gmaclennan commented Aug 30, 2024

Just seeing this now following the issues with the front end. I think there are one or two things we need to review here. I can take a look Monday morning. @EvanHahn @tomasciccola

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove optional fields from protobufs unless they're truly optional
3 participants